Skip to content

feat(anr): [Non-Fatal ANR 7] Sample app and UI test for non-fatal ANRs - #6728

Open
markushi wants to merge 2 commits into
markushi/feat/non-fatal-anr-5-report-non-fatal-anrsfrom
markushi/feat/non-fatal-anr-7-sample-and-ui-test
Open

markushi wants to merge 2 commits into
markushi/feat/non-fatal-anr-5-report-non-fatal-anrsfrom
markushi/feat/non-fatal-anr-7-sample-and-ui-test

Conversation

@markushi

Copy link
Copy Markdown
Member

Adds sample app buttons and a UI test for non-fatal ANRs, and the CHANGELOG entry.

Design: Non-Fatal ANR Architecture (JAVA-777)

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

🤖 Generated with Claude Code

@markushi
markushi added this pull request to stack #6730 November 20, 2026 17:55
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit d261c23.

The model rated this change low. It was raised to medium because:

  • R7: the model was not confident enough that the change is low

This label is a hint for reviewers, not an approval.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- [Non-Fatal ANR 7] Sample app and UI test for non-fatal ANRs ([#6728](https://github.com/getsentry/sentry-java/pull/6728))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against d261c23

@sentry

sentry Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 23, 2026
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 24, 2026
@markushi
markushi removed this pull request from stack #6730 November 24, 2026 13:01
@markushi
markushi added this pull request to stack #6753 November 24, 2026 13:02
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 24, 2026
@markushi
markushi marked this pull request as ready for review November 24, 2026 13:11
@markushi
markushi requested review from a team and adinauer as code owners November 24, 2026 13:11
@markushi
markushi requested review from 0xadam-brown and romtsn and removed request for a team November 24, 2026 13:11
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 24, 2026
@markushi
markushi removed this pull request from stack #6753 November 25, 2026 09:41
@markushi
markushi changed the base branch from markushi/feat/non-fatal-anr-6-skip-duplicate-fatal-anr to markushi/feat/non-fatal-anr-5-report-non-fatal-anrs November 25, 2026 09:41
@github-actions github-actions Bot removed the risk: medium PR risk score: medium label Nov 25, 2026
@markushi
markushi force-pushed the markushi/feat/non-fatal-anr-7-sample-and-ui-test branch from 8f190b0 to 72aa113 Compare November 25, 2026 09:41
@markushi
markushi added this pull request to stack #6761 November 25, 2026 09:41
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 25, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 72aa113. Configure here.

assertTrue(durationMs.toLong() >= 700, "duration_ms: $durationMs")
}
assertNoOtherEnvelopes()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI test flakes on extra ANR envelopes

Medium Severity

blockingMainThreadSendsOneNonFatalAnrEvent increments the relay idling resource once and requires exactly one envelope after launching EmptyActivity and sleeping 2s on the main thread. Hang detection starts at onStart and can already report a non-fatal ANR if AppCompat startup blocks the main thread for the 700 ms threshold, then the sleep sends a second event. waitUntilIdle can return after the first envelope, so assertNoOtherEnvelopes races and the extra decrement can corrupt CountingIdlingResource.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bugbot

Reviewed by Cursor Bugbot for commit 72aa113. Configure here.

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant